﻿Imports DTO
Imports DAO
Public Class DonViBUS

    Public Shared Function LayDSDonViCbx() As DataTable
        Return DonViDAO.LayDSDonViCbx()
    End Function

    Public Shared Function LayDSDonVi() As DataTable
        Return DonViDAO.LayDSDonVi()
    End Function

    Public Shared Function ThemDonVi(dv As DonViDTO) As Boolean
        Dim kt As Boolean = True
        If dv.TenDonVi.Length = 0 Then
            Return False
        End If
        DonViDAO.ThemDonVi(dv)
        Return kt
    End Function

    Public Shared Function CapNhatDonVi(dv As DonViDTO) As Boolean
        Dim kt As Boolean = True
        If dv.TenDonVi.Length = 0 Then
            Return False
        End If
        DonViDAO.CapNhatDonVi(dv)
        Return kt
    End Function

    Public Shared Function XoaDonVi(dv As DonViDTO) As Boolean
        Dim kt As Boolean = True
        DonViDAO.XoaDonVi(dv)
        Return kt
    End Function

    Public Shared DongKetNoi As SqlClient.SqlConnection = CKetNoi.Connect

End Class
